package datatype

object CharDemo {
  def main(args: Array[String]): Unit = {
    val n1: Char = 97
    val n2: Char = '沈'
    println("n1 = " + n1)
    println("n2 = " + n2.toInt)
    val n4: Char = 98 // ok，因为直接将一个数值给Char，编译器只判断是否越界
    val n3 = '运' + 67   // Char -> Int ok  Int -> Char not ok 判断类型
    val n5: Char = ('运' + 67).toChar   // Char -> Int ok  Int -> Char not ok 判断类型
    println("n3 = " + n3)
    println("n4 = " + n4)
    print("n5 = " + n5)
    val n6 = '\n'

    val s: String = "crazy" * 3
    println(s)
    10 max 2
    BigInt(2).pow(1024)
    "Hello".head
    "Hello".take(0)
    "Hello"(0)
  }
}
